import java.util.HashMap;

public class Test02 {
    public boolean CheckPermutation(String s1, String s2) {
        char[] char1 = s1.toCharArray();
        char[] char2 = s2.toCharArray();
        if(char1.length != char2.length) return false;
        HashMap<Character, Integer> map1 = new HashMap<>();
        HashMap<Character, Integer> map2 = new HashMap<>();
        for(int i = 0; i < char1.length; i++){
            map1.put(char1[i], map1.getOrDefault(char1[i] , 0) + 1);
        }
        for(int i = 0 ; i < char2.length; i++){
            map2.put(char2[i], map2.getOrDefault(char2[i] , 0) + 1);
        }
        for(int i = 0; i < char1.length; i++){
            if(map1.get(char1[i]) != map2.get(char1[i])){
                return false;
            }
        }
        return true;

    }
}
